<% def springSecurityService = application.getAttribute("org.codehaus.groovy.grails.APPLICATION_CONTEXT").getBean("springSecurityService") %>
<% def stringManagerService = application.getAttribute("org.codehaus.groovy.grails.APPLICATION_CONTEXT").getBean("stringManagerService") %>

<table><tr>
<g:if test="${stringManagerService.checkObjectInString(springSecurityService?.currentUser,postInstance?.likes)}">
  <td>${stringManagerService.countMemberInString(postInstance?.likes)} People like this.</td><td> <g:remoteLink controller="post" action="dislike" id="${postInstance?.id}" update="show_like"><input type="submit" class="btn_dislike" value=""/></g:remoteLink></td>
</g:if><g:else>
  <td>${stringManagerService.countMemberInString(postInstance?.likes)} People like this.</td><td> <g:remoteLink controller="post" action="like" id="${postInstance?.id}" update="show_like"><input type="submit" class="btn_like" value=""/></g:remoteLink></td>
</g:else>
</tr></table>